package com.jjty.dataGenerator.akq.service;

import com.jjty.dataGenerator.akq.entity.*;
import com.jjty.dataGenerator.akq.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DataService {
    @Autowired
    private BaseDataMapper baseDataMapper;
    @Autowired
    private HeartbeatDataMapper functionalDataMapper;
    @Autowired
    private DeviceDataMapper deviceDataMapper;
    @Autowired
    private CallInfoDataMapper callInfoDataMapper;
    @Autowired
    private LocationDataMapper locationDataMapper;
    @Autowired
    private AlarmDataMapper alarmDataMapper;


    public void saveData(BaseDataEntity data) {
        // 保存数据到数据库
        baseDataMapper.insert(data);
    }
    public void saveFunctionalData(HeartbeatDataEntity data) {
        // 保存功能数据到数据库
        functionalDataMapper.insert(data);
    }

    public void saveDeviceData(DeviceDataEntity data) {
        // 保存设备数据到数据库
        deviceDataMapper.insert(data);
    }
    public void saveCallInfoData(CallInfoDataEntity data) {
        // 保存通话信息数据到数据库
        callInfoDataMapper.insert(data);
    }

    public void saveLocationData(LocationDataEntity data) {
        // 保存位置数据到数据库
        locationDataMapper.insert(data);
    }

    public void saveAlarmData(AlarmDataEntity data) {
        // 保存位置数据到数据库
        alarmDataMapper.insert(data);
    }
}
